<template>
  <div class="my-like-content">
    <!-- 头部区域 -->
    <div class="header-section">
      <img src="/images/主体页面组件/头部header.svg" alt="头部背景" class="header-bg" />
      <div class="header-content">
        <img src="/images/主体页面组件/头部蓝酒馆logo.svg" alt="蓝酒馆logo" class="header-logo" />
        <img src="/images/主体页面组件/头部slogan.svg" alt="slogan" class="header-slogan" />
      </div>
    </div>

    <!-- 主内容区域 -->
    <div class="main-content">
      <!-- 标题区域 -->
      <div class="title-section">
        <img src="/images/我的喜欢/我的喜欢.svg" alt="我的喜欢" class="like-title" />
      </div>
      
      <!-- 我的喜欢内容区域 -->
      <div class="like-section">
        <img src="/images/我的喜欢/我的喜欢bg.svg" alt="我的喜欢背景" class="like-bg" />
        <div class="like-overlay">
          <!-- 喜欢卡片区域
          <div class="like-card" @click="addLike">
            <img src="/images/我的推荐/我的推荐加号.svg" alt="添加喜欢" class="add-icon" />
          </div> -->
        </div>
      </div>
    </div>

    <!-- 底部导航栏 -->
    <div class="bottom-nav">
      <img src="/images/主体页面组件/底部导航栏bg.svg" alt="导航背景" class="nav-bg" />
      <div class="nav-items">
        <button class="nav-item" @click="$router.push('/home')">
          <img src="/images/主体页面组件/首页logo.svg" alt="首页" />
          <span class="nav-text">首页</span>
        </button>
        <button class="nav-item" @click="$router.push('/recommend')">
          <img src="/images/主体页面组件/推荐logo.svg" alt="推荐" />
          <span class="nav-text">推荐</span>
        </button>
        <button class="nav-item active" @click="$router.push('/bookshelf')">
          <img src="/images/主体页面组件/书架logo.svg" alt="书架" />
          <span class="nav-text">书架</span>
        </button>
        <button class="nav-item" @click="$router.push('/my')">
          <img src="/images/主体页面组件/我的logo.svg" alt="我的" />
          <span class="nav-text">我的</span>
        </button>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'

const router = useRouter()

// 添加喜欢功能
const addLike = () => {
  // 添加喜欢逻辑
  console.log('添加喜欢')
}
</script>

<style scoped>
.my-like-content {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  background: #f5f5f5;
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  /* 禁用文本选择和拖拽 */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* 头部区域样式 */
.header-section {
  position: relative;
  width: 100%;
  height: 65px;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
  background: #A2F2F8;
}

.header-bg {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
}

.header-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.header-logo {
  height: 30px;
  width: auto;
  transform: translateY(35%) translateX(10%);
}

.header-slogan {
  height: 40px;
  width: auto;
  transform: translateY(35%) translateX(50%);
}

/* 主内容区域样式 */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 15px;
  padding-bottom: 120px; /* 为导航栏留出空间 */
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 0;
  min-height: 0;
  /* 启用移动端原生滑动 */
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  /* 隐藏滚动条 */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* 完全隐藏滚动条 */
.main-content::-webkit-scrollbar {
  display: none;
}

.title-section {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  padding: 0 25px;
}

.like-title {
  height: 32px;
  width: auto;
  object-fit: contain;
  transform: translateX(-20%);
}

/* 我的喜欢区域样式 */
.like-section {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  height: 150px;
  flex-shrink: 0;
}

.like-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  position: absolute;
  top: 0;
  left: 0;
}

.like-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  z-index: 5;
}

.like-card {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 80px;
  padding-left: 25px;
}

.like-card:hover .add-icon {
  opacity: 0.8;
}

.add-icon {
  width: 80px;
  height: 80px;
  object-fit: contain;
  opacity: 1;
  display: block;
}

/* 底部导航栏样式 */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  z-index: 9999;
  margin: 0;
  padding: 0;
  background: transparent;
  padding-top: 5px;
}

.nav-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-items {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding: 0px 20px 20px 20px;
}

.nav-item {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px 12px 8px;
  transition: transform 0.2s ease;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
}

.nav-item:hover {
  transform: scale(1.1);
}

.nav-item.active {
  background: rgba(0, 212, 255, 0.1);
}

.nav-item img {
  height: 32px;
  width: auto;
}

.nav-text {
  font-size: 12px;
  color: #ffffff;
  font-weight: 400;
  margin-top: 2px;
}

.nav-item.active .nav-text {
  color: #0033ff;
  font-weight: 500;
}

/* 响应式调整 */
@media (max-height: 700px) {
  .header-section {
    height: 55px;
  }
  
  .main-content {
    padding: 12px;
    padding-bottom: 90px;
    gap: 12px;
  }
  
  .like-section {
    height: 130px;
  }
  
  .title-section {
    margin-bottom: 12px;
    padding: 0 20px;
  }
  
  .like-title {
    height: 26px;
  }
  
  .like-card {
    min-height: 60px;
    padding-left: 20px;
  }
  
  .add-icon {
    width: 60px;
    height: 60px;
  }
  
  .bottom-nav {
    height: 80px;
  }
  
  .nav-item img {
    height: 28px;
  }
  
  .nav-text {
    font-size: 11px;
  }
}

/* 小屏幕调整 */
@media (max-width: 399px) {
  .title-section {
    margin-bottom: 15px;
    padding: 0 18px;
  }
  
  .like-title {
    height: 24px;
  }
  
  .like-card {
    min-height: 70px;
    padding-left: 18px;
  }
  
  .add-icon {
    width: 70px;
    height: 70px;
  }
}

/* 大屏幕优化 */
@media (min-width: 400px) {
  .like-section {
    height: 170px;
  }
  
  .title-section {
    margin-bottom: 18px;
    padding: 0 30px;
  }
  
  .like-title {
    height: 32px;
  }
  
  .like-card {
    min-height: 90px;
    padding-left: 30px;
  }
  
  .add-icon {
    width: 90px;
    height: 90px;
  }
}
</style> 